<template>
  <div class="divLogin">
    <div class="login-container">
      <div class="left">
        <div class="title"><img src="../../assets/login/title.png" alt=""></div>
        <el-form ref="form" :model="form" class="form" :rules="rules">
          <div class="model">
            <div class="img"><img src="../../assets/login/mobile.png" alt=""></div>
            <div class="input">
              <el-form-item prop="model">
                <el-input v-model="form.model" placeholder="请输入内容" />
              </el-form-item>
            </div>
          </div>
          <div class="model">
            <div class="img"><img src="../../assets/login/pwd.png" alt=""></div>
            <div class="input">
              <el-form-item prop="password">
                <el-input v-model="form.password" show-password type="password" placeholder="请输入密码" />
              </el-form-item>
            </div>
          </div>
        </el-form>
        <el-checkbox v-model="checked" style="margin-left:60px">记住密码</el-checkbox>
        <el-button class="btn" plain @click="btn">立即登录</el-button>
      </div>
      <div class="right" />
    </div>
  </div>
</template>

<script>

import { setToken } from '@/utils/auth'
export default {
  components: {},
  data() {
    return {
      form: {
        model: 'admin',
        password: '111111',
        token: 'sadfsdfsefseF'
      },
      rules: {
        model: [
          { required: true, message: '请输入账号', trigger: 'blur' }
        ],
        password: [
          { required: true, message: '请输入密码', trigger: 'change' }
        ]
      },
      checked: false
    }
  },

  methods: {
    btn() {
      setToken(this.form.token)
      this.$router.push('/')
    }
  }
}
</script>
<style lang='scss' scoped>
::v-deep {
  .el-input__inner {
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    height: 50px;
    background-color: #f8f5f5;
    font-size: 14px;
  }
}
.divLogin {
  background-color: #fdfafa;
}

.login-container {
  width: 958px;
  height: 516px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgb(93 93 93 / 33%);
  background-color: #fff;
  border-radius: 40px;
  overflow: hidden;

  .left {
    float: left;
    width: 398px;
    height: 516px;
    .title {
      margin-left: 124px;
      margin-top: 72px;
      img {
        width: 150px;
        height: 64px;
      }
    }
    .form {
      margin-left: 60px;
      .model {
        display: flex;
        margin-top: 50px;
        margin-bottom: 20px;
        .img {
          width: 50px;
          height: 50px;
          background: #eae7e7;
          border-radius: 8px 0 0 8px;
          img {
            width: 25px;
            height: 24px;
            margin: 12px 13px;
          }
        }
        .input {
          width: 230px;
          height: 50px;
          border-bottom-left-radius: 0;
          border-top-left-radius: 0;
        }
      }
    }
    .btn{
      width: 280px;
      height: 50px;
      margin-left: 60px;
      margin-top: 20px;
      font-size: 16px;
      font-weight: 600;
          background-color: #ffb200;
      color: #332929;
    }
  }

  .right {
    float: right;
    background: url('../../assets/login/contentBg.png') no-repeat;
    background-size: cover;
    width: 560px;
    height: 516px;
  }
}
</style>
